package tedu.study.day02;

public class Day02Practise {
    public static void main(String[] args) {
        //变量的练习
        int a;
        int b,c,d;

        int a1 = 0;
        int b1;
        b1 = 1;

        int g = 5;
        int h = g+10;
        System.out.println(h);

        g=g+10;
        System.out.println(g);

        int a_$1,_2a,$r5;//可使用字母、数字、_和$
        int age;//使用英文，望文知意
        //int 1a;//数字不能开头
        //int a1;//名称不能重复
        //int class;//不能使用关键字
        //int h;//避免使用，不知其意

        //数据类型的练习int
        int num1=10,num2=3;
        System.out.println(num1/num2);

        int bigNum1 = 1500000000;
        int bigNum2 = 1000000000;
        System.out.println(bigNum1+bigNum2);

        //数据类型的练习long
        long longNum1 = 10000L;
        long longNum2 = 20000000L;

        long longNum3 = 1000000000L*5*10;


        //数据的基本类型double
        double dNum = 25.678;
        float fNum = 25.999F;

        double dNum1 = 5.5;
        double dNum2 = 4.9;
        System.out.println(dNum1-dNum2);

        double dNum3 = 6.1;
        double dNum4 = 3.1;
        System.out.println(dNum3 -dNum4);

        //数据的基本类型boolean
        boolean flag1 = true;
        boolean flag2 = false;

        //数据的基本类型char
        char c1 = '男';
        char c2 = 'a';
        char c3 = '1';
        char c4 = ' ';
        char c5 = '\'';
        char c6 = '\\';

        //数据类型的转换，两种方式
        byte b7 = 5;
        short s7 = b7;
        int i7 = s7;
        long l7 = i7;
        float f7 = l7;
        double d7 = f7;

        i7 = (int)d7;

        long l77 = 10000000000L;
        int i77 = (int)l77;//数据溢出

        double d77 = 66.9987;
        int i777 = (int)d77;//数据精度丢失

        //数据类型转换，两点规则
        byte b81 = 10;
        byte b82 = 20;

        byte b88 = (byte)(b81+b82);
        System.out.println(b88);
        System.out.println('A'+'5');


    }
}
